package com.cn.aam.checaiduo.backend.observer;

import com.cn.aam.checaiduo.base.BaseActivity;
import com.cn.aam.checaiduo.bean.base.NormalResponseB;
import com.cn.aam.checaiduo.bean.base.PageB;
import com.cn.aam.checaiduo.widget.WMProgressBar;
import com.cn.aam.checaiduo.widget.WMToast;
import com.orhanobut.logger.Logger;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * 用于处理列表数据
 */
public abstract class OnRequestListV2Listener<T> extends BaseObserver<PageB<T>> {


    public OnRequestListV2Listener(BaseActivity baseActivity) {
        super(baseActivity);
    }

    @Override
    public void onNext(PageB<T> value) {
        Logger.json(value.toJson());
        if (value.getCode() == 0) {
            WMToast.normal("" + value.getMsg());
        }
    }

}
